package com.csun.cmny.provider.dto;

import com.csun.cmny.provider.validator.OmcGiftAddValidator;
import com.csun.cmny.provider.validator.OmcOrderAddValidator;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-05-21 11:42
 * @Description: the class order dto
 */
@Data
public class OrderDto {

    /**
     * 老人Id
     */
    @NotNull(message = "{order.oldman.id.null}",
            groups = {OmcOrderAddValidator.class})
    private Long oldmanId;

    /**
     * 服务项目
     */
    @NotNull(message = "{order.service.id.null}",
            groups = {OmcOrderAddValidator.class})
    private Long serviceId;

    /**
     * 服务时间
     */
    @NotNull(message = "{order.service.time.null}",
            groups = {OmcOrderAddValidator.class})
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date serviceTime;

    /**
     * 服务地址
     */
    @NotNull(message = "{order.service.address.null}",
            groups = {OmcOrderAddValidator.class})
    @NotEmpty(message = "{order.service.address.null}",
            groups = {OmcOrderAddValidator.class})
    private String serviceAddress;

    /**
     * 服务时长
     */
    private String serviceDuration;

    /**
     * 订单积分
     */
    @NotNull(message = "{order.integral.null}")
    private Integer integral;

    /**
     * 说明
     */
    private String remark;

    /**
     * 组织Id
     */
    private Long groupId;
}
